package com.neighbor.neighborhooduser.dao;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.neighbor.neighborhooduser.pojo.Notifications;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 系统通知表 Mapper 接口
 * </p>
 *
 * @author song
 * @since 2025-09-22 09:13:04
 */
public interface INotificationsDao extends BaseMapper<Notifications> {

    Notifications latestNotice();

    // 分页查询用户通知
    IPage<Notifications> selectUserNotifications(Page<Notifications> page,
                                                @Param("userId") Integer userId,
                                                @Param("type") Integer type);

    // 查询未读通知数量
    Integer selectUnreadCount(@Param("userId") Integer userId);

    List<Notifications> getAllNotification(Integer userId);
}
